import enums.FruitType;
import handle.SupermarketHandle;

/**
 * @Description:测试用例
 * @author: panhui.zhang
 * @date: 2024/5/6
 */
public class Main {
    public static void main(String[] args) {
        customerA();//顾客A
        customerB();//顾客B
        customerC();//顾客C
        customerD();//顾客D
//        testCases();//测试边界值
    }

    private static void customerA() {
        SupermarketHandle customerA = new SupermarketHandle.Shopping()
                .buy(FruitType.APPLE, 1)
                .buy(FruitType.STRAWBERRY, 1).build();
        System.out.println("顾客A的商品总价:"+ customerA.totalPrice());
    }

    private static void customerB() {
        SupermarketHandle customerB = new SupermarketHandle.Shopping()
                .buy(FruitType.APPLE, 1)
                .buy(FruitType.STRAWBERRY, 1)
                .buy(FruitType.MANGO, 1).build();
        System.out.println("顾客B的商品总价:"+ customerB.totalPrice());
    }

    private static void customerC() {
        SupermarketHandle customerC = new SupermarketHandle.Shopping()
                .buy(FruitType.APPLE, 1)
                .buy(FruitType.STRAWBERRY, 1, true)
                .buy(FruitType.MANGO, 1).build();
        System.out.println("顾客C的商品总价:"+ customerC.totalPrice());
    }

    private static void customerD() {
        SupermarketHandle customerD = new SupermarketHandle.Shopping()
                .buy(FruitType.APPLE, 1)
                .buy(FruitType.STRAWBERRY, 5, true)
                .buy(FruitType.MANGO, 2).build();
        System.out.println("顾客D的商品总价:"+ customerD.discountTotalPrice());
    }

    private static void testCases() {
        SupermarketHandle test = new SupermarketHandle.Shopping()
                .buy(FruitType.APPLE, 1)
                .buy(FruitType.STRAWBERRY, 1)
                .buy(FruitType.MANGO, 4)//边界值101元
//                .buy(FruitType.MANGO, 3.9495)//边界值99.99
                .build();
        System.out.println("边界值商品原总价:"+ test.totalPrice());
        System.out.println("边界值商品优惠总价:"+ test.discountTotalPrice());

    }

}
